#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'
#define REP(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define PER(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)

template<typename T=int>
inline T read() {
    T x;
    cin >> x;
    return x;
}

const int maxn = 1000;
int a[maxn], n;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    n = read();
    REP(i, 0, n)a[i] = read();
    sort(a, a + n);
    int m = unique(a, a + n) - a;
    cout << m << endl;
    REP(i, 0, m) {
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}
